/**
 * @(#)ArticleCategoryVO.java.java	1.0  21-05-2014
 *
 * Copyright 2014 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.entities.vo;

import java.util.ArrayList;
import java.util.List;

/**
 *  Mapping danh muc bai viet
 *  @author: toantm1
 *  @since: Thoi gian tao 21-05-2014 - 08:40:44
 */

public class ArticleCategoryVO {
	private int id;
	private String name;
	private String childrentLst;
	private List<ArticleCategoryVO> lstCategory = new ArrayList();
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the childrentLst
	 */
	public String getChildrentLst() {
		return childrentLst;
	}
	/**
	 * @param childrentLst the childrentLst to set
	 */
	public void setChildrentLst(String childrentLst) {
		this.childrentLst = childrentLst;
	}
	/**
	 * @return the lstCategory
	 */
	public List<ArticleCategoryVO> getLstCategory() {
		return lstCategory;
	}
	/**
	 * @param lstCategory the lstCategory to set
	 */
	public void setLstCategory(String lstCategory) {
		List<ArticleCategoryVO> lst = new ArrayList<ArticleCategoryVO>();
		if (lstCategory != null) {
			String[] itemList = lstCategory.split(";");
			String[] column;
			if (itemList.length > 0) {
				for (String item : itemList) {
					column = item.split(",");
					if (column.length > 0) {
						ArticleCategoryVO vo = new ArticleCategoryVO();
						vo.setId(Integer.parseInt(column[0]));
						vo.setName(column[1]);
						lst.add(vo);
					}
				}
			}
		}
		this.lstCategory = lst;
	}
}
